Frame

interface Frame

A frame in the browser.

Each web page loaded in the browser has a main (top-level) frame. The frame itself may have child frames. When a web page is unloaded, its frame and all child frames are closed automatically. Any attempt to work with an already closed frame will lead to the IllegalStateException error.

Properties

Link copied to clipboard

Browser instance of this frame.

Link copied to clipboard

The list of child frames or an empty list if this frame does not have any children.

Link copied to clipboard

The document object model (DOM) of this frame, if any.

Link copied to clipboard

Content of the frame in the HTML format, or an empty string if the frame doesn't have a content or its content is empty.

Link copied to clipboard

The Json instance for this frame.

Link copied to clipboard

The localStorage instance of this frame.

Link copied to clipboard

The name of the frame, or an empty string if the frame doesn't have a name.

Link copied to clipboard

The parent Frame instance or null if the current frame is a main (top-level) frame, and it does not have a parent.

Link copied to clipboard

The sessionStorage instance of this frame.

Functions

Link copied to clipboard
abstract fun browser(): Browser
Returns the Browser instance of this frame.
Link copied to clipboard
abstract fun children(): List<Frame>
Returns the list of child frames or an empty list if this frame does not have any children.
Link copied to clipboard
abstract fun document(): Optional<Document>
Returns an Optional that contains the DOM Document instance of the frame or an empty Optional if the frame does not have a document.
Link copied to clipboard
abstract fun execute(command: EditorCommand): Boolean
Executes the given command in the frame.
Link copied to clipboard
@Nullable
abstract fun <T> executeJavaScript(javaScript: String): T
Executes the given javaScript code in the frame and returns the result of the execution.
abstract fun executeJavaScript(javaScript: String, callback: Consumer<out Any>)
Executes the given javaScript code in the frame and returns the result of the execution through the given callback.
Link copied to clipboard
abstract fun hasSelection(): Boolean
Returns true if some content in this frame is selected.
Link copied to clipboard
abstract fun html(): String
Returns a string that represents content of the frame in the HTML format or an empty string if the frame does not have a content or its content is empty.
Link copied to clipboard
abstract fun inspect(location: Point): PointInspection
Inspects the given location on the web page containing this frame and returns the result of the inspection.
abstract fun inspect(x: Int, y: Int): PointInspection
Inspects the given location on the web page containing this frame and returns the result of the inspection.
Link copied to clipboard
abstract fun isCommandEnabled(commandName: EditorCommand.Name): Boolean
Returns true if the command with the given commandName can be executed in the frame.
Link copied to clipboard
abstract fun isMain(): Boolean
Returns true if the frame is a main (top-level) frame in the browser.
Link copied to clipboard
abstract fun json(): Json
Returns the Json instance for this frame.
Link copied to clipboard
abstract fun loadHtml(html: String)
Navigates the frame to a data URL assembled from the given HTML.
Link copied to clipboard
abstract fun loadUrl(url: String)
Navigates the frame to a resource identified by the given url.
Link copied to clipboard
abstract fun localStorage(): WebStorage
Returns the localStorage instance of this frame.
Link copied to clipboard
abstract fun name(): String
Returns a string that represent the name of the frame or an empty string if the frame does not have a name.
Link copied to clipboard
abstract fun parent(): Optional<Frame>
Returns an Optional that contains the parent Frame instance or an empty Optional if the current frame is a main (top-level) frame and it does not have a parent.
Link copied to clipboard
abstract fun print()
Requests printing of the currently loaded web page in this frame.
Link copied to clipboard
Returns a RenderProcess associated with the current Frame instance.
Link copied to clipboard
abstract fun selectionAsHtml(): String
Returns a string that contains HTML of the selected content in the frame or an empty string if there is no selection.
Link copied to clipboard
abstract fun selectionAsText(): String
Returns a text representation of the selected content in the frame or an empty string if there is no selection.
Link copied to clipboard
abstract fun sessionStorage(): WebStorage
Returns the sessionStorage instance of this frame.
Link copied to clipboard
abstract fun text(): String
Returns the content of the frame and its sub-frames as plain text or an empty string if the frame does not have content or its content is empty.
Link copied to clipboard
abstract fun viewSource()
Creates a new popup where the view-source:<frame-url> URL is loaded to display HTML source of the frame.